Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Major build improvements #1668

Merged
merged 17 commits into from
Apr 21, 2023
Merged

Major build improvements #1668

merged 17 commits into from
Apr 21, 2023

Conversation

Panquesito7
Copy link
Member

@Panquesito7 Panquesito7 commented Feb 7, 2023

Things added/changed:

  • Major build improvements.
    • New detailed guide on how to build Devicon locally has been added (Windows & Linux-based systems).
    • Building Devicon on Gitpod.io is now possible with a single click.
    • Sneak peek of new icons can be seen by building locally.
    • A few other improvements were done, such as providing a Geckodriver (latest version) for both Linux 64 and Windows 64.
    • The website will now check if CSS/build files are found in the root directory, otherwise, will use predefined CDN latest release links.
    • P.S.: a few of the file changes (such as the font folder changes or devicon-base.css) weren't changed. Not sure why GitHub displays it like that. 🤔

NOTE: This will need proper testing. I already tested and it works perfectly fine without any issues.
Any doubts, suggestions, or questions, please let me know about it. Thanks! 🙂

Gitpod ready-to-code

@Panquesito7 Panquesito7 added enhancement devops Use this label for devops related enhancements labels Feb 7, 2023
@Panquesito7 Panquesito7 requested a review from a team February 7, 2023 07:20
Copy link
Collaborator

@Snailedlt Snailedlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't reviewed everything yet, but I don't have more time today, so I figured I'd post this in case you want to look at it before I get the chance to review the rest :)

icons/nano/nano-original-wordmark.svg Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
.github/scripts/build_assets/arg_getters.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@Snailedlt Snailedlt requested review from lunatic-fox and a team March 4, 2023 13:36
lunatic-fox
lunatic-fox previously approved these changes Mar 6, 2023
Copy link
Contributor

@lunatic-fox lunatic-fox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! 🚀

@Panquesito7 Panquesito7 dismissed Snailedlt’s stale review March 9, 2023 21:02

Reviews already addressed.

Copy link
Collaborator

@Snailedlt Snailedlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

README looks good now 💯

One of the nano icons is still changed and needs to be reverted though.
Other than that I mostly just have some questions to better understand the code.

Not much left now until we can merge 🚀

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change still needs to be reverted

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted all the changes in the icon; not sure what else should I do. 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Odd, maybe we can try and find which commit the file was changed in?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All I did is copy the nano icon contents from the develop branch. Probably some Git-meta changes or such.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhh, have you tried git revert?

.github/scripts/build_assets/arg_getters.py Show resolved Hide resolved
</head>

<body ng-app="devicon" ng-controller="IconListCtrl">
<link rel="stylesheet" ng-if="latestReleaseTagging" ng-href="https://cdn.jsdelivr.net/gh/devicons/devicon@{{ latestReleaseTagging }}/devicon.min.css">
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not needed anymore? Could you explain what it did, and why we don't need it anymore?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Yes it is needed, but it is added by the script above.
  2. The stylesheet file (devicon.min.css) loads all the icons data, colors, etc..
  3. As I said, it is added by the JavaScript script above.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. It would probably be less code to move the script to the .js file and add a variable, then use that variable here instead of adding the element via the DOM.
That would more closely follow the SOLID principle too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, you're saying to move the whole script to another JS file and load the script via HTML?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sort of. Moving it to the .js file, but using Angular features instead of interacting directly with the DOM. It's less complex and less code that way.

docs/index.html Outdated Show resolved Hide resolved
docs/index.html Outdated Show resolved Hide resolved
docs/index.html Outdated Show resolved Hide resolved
Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com>
@lunatic-fox
Copy link
Contributor

Since this branch has some permissions, here goes the updated fonts.

update-fonts.zip 📚

SHA256: 26d9bbcf761c9edeec84d6445507e2494514dd5b4ce8462fb6b2406b3c0c4ab3
MD5: 395e30870869531dfb681d26b24c140c

This .zip contains:

  • devicon.min.css
  • fonts/devicon.eot
  • fonts/devicon.svg
  • fonts/devicon.ttf
  • fonts/devicon.woff

@Snailedlt
Copy link
Collaborator

Snailedlt commented Mar 23, 2023

@lunatic-fox

Thanks. It works perfectly with those fonts!
image

How did you build it, and which OS do you use?

@lunatic-fox
Copy link
Contributor

@lunatic-fox

Thanks. It works perfectly with those fonts! image

How did you build it, and which OS do you use?

I made a script with Node.js to get all valid icons to upload to Icomoon and I'm on Windows 10.

@Snailedlt
Copy link
Collaborator

@lunatic-fox care to share the script? :)

@lunatic-fox
Copy link
Contributor

@lunatic-fox care to share the script? :)

I made it first with local files, but I've made another version using fetch.
This will need a icomoon directory created and Node.js 17.5.^.

const fs = require('fs');
const baseURL = 'https://cdn.jsdelivr.net/gh/devicons/devicon@develop/';
(async() => {
  const devicon = await(await fetch(`${baseURL}devicon.json`)).json();
  for (const e of devicon) {
    for (const f of e.versions.font) {
      const icon = await fetch(`${baseURL}icons/${e.name}/${e.name}-${f}.svg`);

      if (icon.status === 200) {
        console.log(`> ${e.name}-${f}`);
        fs.writeFileSync(`icomoon/${e.name}-${f}.svg`, await (icon.text()));
      }
    }
  }
})();

@lunatic-fox
Copy link
Contributor

@lunatic-fox care to share the script? :)

I made it first with local files, but I've made another version using fetch. This will need a icomoon directory created and Node.js 17.5.^.

Here goes a faster version:

const fs = require('fs');
const baseURL = 'https://cdn.jsdelivr.net/gh/devicons/devicon@develop/';
(async() => {
  let x = 0, y = 10;
  const devicon = await(await fetch(`${baseURL}devicon.json`)).json();
  const toBuild = [];

  while (true) {
    const deviconChunk = devicon.map(e => ({
      name: e.name,
      font: e.versions.font
    })).slice(x, y);

    if (deviconChunk.length === 0) break;

    for (const e of deviconChunk) {
      for (const f of e.font) {
        const icon = await fetch(`${baseURL}icons/${e.name}/${e.name}-${f}.svg`);
  
        if (icon.status === 200) {
          const svg = await icon.text();
          toBuild.push({
            path: `${e.name}-${f}.svg`,
            icon: svg
          });
          console.log(`> ${e.name}-${f}`);
        }
      }
    }
    x += 10, y += 10;
  }

  toBuild.forEach(e => fs.writeFileSync(`icomoon/${e.path}`, e.icon));
})();

Panquesito7 and others added 2 commits April 7, 2023 12:55
* Make README more readable

* move logic from index.html to script.js

* fix devicon min css in head

* Fix build script missing token error

* Add more print statements to local build script

* Change from ng-href to href in code view

* Minor readme improvements

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Copy link
Collaborator

@Snailedlt Snailedlt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! ✔️

Like we already discussed, I had trouble running it locally. If the issue persists we can look at that later. For now it's good enough that it runs on GitPod imo :)
Let's get this release out ASAP :D

@Panquesito7 Panquesito7 merged commit b6e387d into devicons:develop Apr 21, 2023
@Panquesito7 Panquesito7 deleted the panquesito7/improve/build branch April 21, 2023 14:46
@Snailedlt Snailedlt mentioned this pull request Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Use this label for devops related enhancements enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants